export default {
    namespaced: true,
    state: {
        isshowtoast: false,
        msg: '',
        type: ''
    },
    mutations: {
        chanisshowtoast(state, payload) {
            state.isshowtoast = payload.isshowtoast,
                state.msg = payload.msg,
                state.type = payload.type
        }
    },
    actions: {
        aysncchanisshowtoast({ commit }, payload) {
            // console.log('payload:',payload);
            commit("chanisshowtoast", {
                isshowtoast: true,
                msg: payload.msg,
                type: payload.type
            })
            setTimeout(() => {
                commit("chanisshowtoast", {
                    isshowtoast: false,
                    msg: payload.msg,
                    type: payload.type
                })
            }, 1500);
        }
    },
}